<html>
	<body>
		<table border="2">
			<tr>
				<th> First Name </th>
				<th> Last Name </th>
				<th> Username </th>
				<th> Usertype </th>
			</tr>
	<?php
		include("users.php");
		$obj = new users();
		
		if(isset($_REQUEST['username'])){
			$username=$_REQUEST['username'];
		}
		
		
		if(!$obj->search_user_by_username($username)){
			echo "Error ".mysql_error();
			exit();
		}
		
		$row=$obj->fetch();
		while($row){
			$userId=$row['userId'];
			echo "<tr><td>".$row['firstname']. "</td>";
			echo "<td>".$row['lastname']."</td>";
			echo "<td>".$row['username']."</td>";
			echo "<td>".$row['usertype']."</td>";
			echo "<td><a target='_blank' href='user_edit.php?userId=$userId'> EDIT </a></td></tr>";
			$row=$obj->fetch();
		}
		
	?>
	</table>
	
		To add a user <a target="_blank" href="add_user.php"> Click here </a> 
	</body>
</html>